import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.SWT;
import org.eclipse.wb.swt.SWTResourceManager;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.events.PaintEvent;


public class NewTrainer {

	protected Shell shell;
	private Text text;
	private Text text_1;
	private Text text_2;
	private Text text_3;
	private Text text_4;

	/**
	 * Launch the application.
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			NewTrainer window = new NewTrainer();
			window.open();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Open the window.
	 */
	public void open() {
		Display display = Display.getDefault();
		createContents();
		shell.open();
		shell.layout();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
	}

	/**
	 * Create contents of the window.
	 */
	protected void createContents() {
		shell = new Shell();
		shell.setSize(700, 500);
		shell.setText("SWT Application");
		
		
		//adding background
		final Display display = Display.getDefault();
		Canvas canvas = new Canvas(shell, SWT.NONE);
		canvas.addPaintListener(new PaintListener() {
			public void paintControl(PaintEvent arg0) {
					 org.eclipse.swt.graphics.Image image = new org.eclipse.swt.graphics.Image(display, "/Users/kennyha/Desktop/Eclipse Workplace/pokemonBackground.png");
					 arg0.gc.drawImage(image, 10, 10);

				        image.dispose();
				
			}
		});
		canvas.setBounds(-14, -14, 714, 492);
		
		Button btnBack = new Button(canvas, SWT.NONE);
		btnBack.setBounds(255, 431, 74, 30);
		btnBack.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseUp(MouseEvent e) {
				Object window;
				shell.close();
				window = new NurseDoctor();
				((NurseDoctor)window).open();
				
			}
		});
		btnBack.setText("Back");
		
		Button btnCancel = new Button(canvas, SWT.NONE);
		btnCancel.setBounds(335, 431, 74, 30);
		btnCancel.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseUp(MouseEvent e) {
				shell.close();
				Object window;
				window = new NurseDoctor();
				((NurseDoctor)window).open();
			}
		});
		btnCancel.setText("Cancel");
		
		Button btnNewButton = new Button(canvas, SWT.NONE);
		btnNewButton.setBounds(415, 431, 74, 30);
		btnNewButton.setText("Save ");
		
		text = new Text(canvas, SWT.BORDER);
		text.setBounds(307, 78, 104, 19);
		
		text_1 = new Text(canvas, SWT.BORDER);
		text_1.setBounds(307, 109, 104, 19);
		
		text_2 = new Text(canvas, SWT.BORDER);
		text_2.setBounds(307, 145, 104, 19);
		
		text_3 = new Text(canvas, SWT.BORDER);
		text_3.setBounds(307, 179, 104, 19);
		
		text_4 = new Text(canvas, SWT.BORDER);
		text_4.setBounds(307, 213, 104, 19);
		
		
		Label lblCreateNewTrainer = new Label(canvas, SWT.NONE);
		lblCreateNewTrainer.setBounds(238, 20, 317, 30);
		lblCreateNewTrainer.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		lblCreateNewTrainer.setFont(SWTResourceManager.getFont("Lucida Grande", 25, SWT.BOLD));
		lblCreateNewTrainer.setAlignment(SWT.CENTER);
		lblCreateNewTrainer.setText("Create New Trainer");
		
		Label lblName = new Label(canvas, SWT.NONE);
		lblName.setBounds(220, 81, 59, 14);
		lblName.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		lblName.setText("Name");
		
		Label lblAddress = new Label(canvas, SWT.NONE);
		lblAddress.setBounds(220, 114, 59, 14);
		lblAddress.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		lblAddress.setText("Address");
		
		Label lblPokegen = new Label(canvas, SWT.NONE);
		lblPokegen.setBounds(220, 148, 73, 14);
		lblPokegen.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		lblPokegen.setText("Pokemon #");
		
		Label lblPokemail = new Label(canvas, SWT.NONE);
		lblPokemail.setBounds(220, 184, 59, 14);
		lblPokemail.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		lblPokemail.setText("Pokemail");
		
		Label lblGender = new Label(canvas, SWT.NONE);
		lblGender.setBounds(220, 257, 59, 14);
		lblGender.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		lblGender.setText("Gender");
		
		Label lblPokemart = new Label(canvas, SWT.NONE);
		lblPokemart.setBounds(220, 218, 59, 14);
		lblPokemart.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		lblPokemart.setText("Pokemart");
		
		Label lblMonth = new Label(canvas, SWT.NONE);
		lblMonth.setBounds(299, 300, 38, 14);
		lblMonth.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		lblMonth.setText("Month");
		
		Label lblDay = new Label(canvas, SWT.NONE);
		lblDay.setBounds(359, 300, 47, 14);
		lblDay.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		lblDay.setText("Day");
		
		Label lblYear = new Label(canvas, SWT.NONE);
		lblYear.setBounds(419, 300, 44, 14);
		lblYear.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		lblYear.setText("Year");
		
		Label lblBirthday = new Label(canvas, SWT.NONE);
		lblBirthday.setBounds(220, 315, 59, 14);
		lblBirthday.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		lblBirthday.setText("Birthday");
		
		Combo combo_1 = new Combo(canvas, SWT.NONE);
		combo_1.setBounds(357, 315, 47, 22);
		combo_1.setItems(new String[] {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"});
		combo_1.select(0);
		
		Combo combo = new Combo(canvas, SWT.NONE);
		combo.setBounds(297, 315, 44, 22);
		combo.setItems(new String[] {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"});
		combo.select(0);
		
		Combo combo_2 = new Combo(canvas, SWT.NONE);
		combo_2.setBounds(417, 315, 59, 22);
		combo_2.setItems(new String[] {"2011", "2010", "2009", "2008", "2007", "2006", "2005", "2004", "2003", "2002", "2001", "2000"});
		combo_2.select(0);
		
		Button btnMale = new Button(canvas, SWT.RADIO);
		btnMale.setBounds(303, 257, 59, 18);
		btnMale.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		btnMale.setText("Male");
		
		Button btnFemale = new Button(canvas, SWT.RADIO);
		btnFemale.setBounds(360, 257, 85, 18);
		btnFemale.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		btnFemale.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
			}
		});
		btnFemale.setText("Female");
		

	}
}
